<?php
$fileType = $_GET["fileType"];
if($fileType=="xlsx")
{
	require_once("export.php");
	require_once("exportForm.php");
	$obj = new ExcelExport();
	$output = new outputAFile();
	$table = $_GET["table"];
	$selectedArr = $_GET["selectedArr"];
	$checkedArr = $_GET["checkedArr"];
	$checkboxArr = $_GET["checkboxArr"];
	$query = new getForm();
	$obj->writeByQuery($query->returnQuery($table,$checkboxArr,$checkedArr,$selectedArr));
	$obj->export("exported/test.xlsx");
	echo "exported/test.xlsx";
}
else if($fileType=="pdf")
{
	require_once("export.php");
	require_once("exportForm.php");
	$obj = new PDFExport();
	$table = $_GET["table"];
	$selectedArr = $_GET["selectedArr"];
	$checkedArr = $_GET["checkedArr"];
	$checkboxArr = $_GET["checkboxArr"];
	$query = new getForm();
	$obj->writeByQuery($query->returnQuery($table,$checkboxArr,$checkedArr,$selectedArr));
	$obj->export("exported/test.PDF");
	echo "exported/test.PDF";
}
?>